package com.example.lesson2;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.context.properties.ConfigurationPropertiesScan;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import java.util.Date;

/**
 *
 * @SpringBootConfiguration
 * 		@Configuration 声明当前对象为配置类，通过@Bean可以配置类
 * @EnableAutoConfiguration
 * @ComponentScan
 */
@SpringBootApplication
@ConfigurationPropertiesScan(basePackages = {"com.example.lesson2"})
public class Lesson2Application {

	@Bean
	public Date sysDate() {
		return new Date();
	}
	public static void main(String[] args) {
		SpringApplication.run(Lesson2Application.class, args);
	}

}
